package com.yzt.minemodule.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.LoadMoreModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.yzt.zhuju.network.entity.mine.BlackListBean;
import com.yzt.zhuju.widget.GenderAgeView;
import com.yzt.minemodule.R;
import com.yzt.plugin_imageloader.ImageLoadUtil;

/**
 * author : bob
 * date   : 2022/12/1
 * desc   : 黑名单的适配器
 */
public class BlackListAdapter extends BaseQuickAdapter<BlackListBean, BaseViewHolder> implements LoadMoreModule {

    public BlackListAdapter() {
        super(R.layout.item_black_list);
    }

    @Override
    protected void convert(BaseViewHolder holder, BlackListBean item) {

        holder.setText(R.id.tv_username, item.getUsername());
        holder.setText(R.id.tv_desc, item.getBio());

        GenderAgeView mGenderAgeView = holder.getView(R.id.gender_age_view);
        mGenderAgeView.setUserInfo(item.getGender(), item.getAge());

        ImageLoadUtil.loadAvatar(getContext(), item.getAvatar(), holder.getView(R.id.img_avatar));
    }
}
